<template>
  <a-collapse
    class="g-collapse"
    :expandIconPosition="'right'"
    :bordered="false"
    @change="collapseChange"
    v-model="activeKey"
  >
    <a-collapse-panel :header="header" isActive="true" @change="activeChange" key="1">
      <!-- <template slot="header"></template> -->
      <slot name="content"></slot>
    </a-collapse-panel>
  </a-collapse>
</template>

<script>
  export default {
    name: 'g-collapse',
    props: {
      header: {
        type: String,
      },
      headerContext: {},
      isActive: {
        type: Boolean,
        default: false,
      },
      activeKey: {
        type: Array,
        default: '[0]',
      },
      type: {
        default: 'default',
      },
    },
    created() {
      this.isOpen = this.isActive;
    },
    data() {
      return {
        isOpen: false,
      };
    },
    methods: {
      activeChange(bool) {
        console.log(bool, 'activeChange');
        this.isOpen = bool;
      },
      collapseChange() {
        this.$emit('collapseChange');
      },
    },
  };
</script>

<style lang="less" scoped>
  @import './g-collapse.less';
</style>
